<!--TODO 没有个股推荐添加的界面-->
<% include ../header.ejs %>
<%
 var mConference = info && info.mConference;
 %>
<script>
    var stockpool = {};
    <% if(mConference){ %>
         stockpool.parentPoolId = '<%= (mConference.parentPoolId && mConference.parentPoolId.rowId) ||'' %>';
         stockpool.childPoolId = '<%= (mConference.childPoolId && mConference.childPoolId.rowId) ||'' %>';
    <%}%>
</script>
<header data-am-widget="header" data-am-sticky class="am-header am-header-default" id="appTemplates-Nav">
    <div class="am-header-left am-header-nav">
        <a href='javascript:history.go(-1)' class="">
            <img class="am-header-icon-custom" src="data:image/svg+xml;charset&#x3D;utf-8,&lt;svg xmlns&#x3D;&quot;http://www.w3.org/2000/svg&quot; viewBox&#x3D;&quot;0 0 12 20&quot;&gt;&lt;path d&#x3D;&quot;M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z&quot; fill&#x3D;&quot;%23fff&quot;/&gt;&lt;/svg&gt;" alt=""/>
        </a>
    </div>

    <h1 class="am-header-title">
        <a href="#title-link" class="" id="Typeface-whitecolor"><%= mConference?'编辑':'新增'%>股票</a>
    </h1>

    <div class="am-header-right am-header-nav">
        <a id="a_save">保存</a>
    </div>
</header>

<form name="addstockpool" class="am-form" method="post" action="save"  enctype="multipart/form-data" data-am-validator>
    <fieldset>
        <div class="am-form-group">
            <label for="doc-vld-name">调入日期：</label>
            <div id="start_datetime" class="am-input-group am-datepicker-date" data-init="<%= mConference && mConference.updateTime%>" data-am-datepicker="{format: 'yyyy-mm-dd', viewMode: 'month'}">
                <input type="text" class="am-form-field" placeholder="选择日期" readonly id="updateTime" name="updateTime" required>
                <span class="am-input-group-btn am-datepicker-add-on">
                    <button class="am-btn am-btn-default" type="button"><span class="am-icon-calendar"></span> </button>
                </span>
            </div>
        </div>
        <div class="am-form-group">
            <label for="doc-vld-name">推荐公司:</label>
            <select class="company-data-ajax" style="width: 100%" id="stockId" name="stockId" required>
                <%if(mConference){%>
                    <option value="<%=mConference.stockId.rowId%>" selected><%=mConference.stockId.stockCode +" "+ mConference.stockId.name%></option>
                <%}%>
            </select>
            <div id="dump_stock" style="display: none;" class="am-alert am-alert-warning" data-am-alert>股票池中已存在该股票，但不限制录入，仍可以保存。</div>
        </div>
        <div class="am-form-group"  style="margin-top: 5px;">
            <label for="doc-vld-name">分析师:</label>
            <select data-am-selected="{btnWidth: '100%'}" placeholder="请选择分析师" id="createUserId" name="createUserId" required>
                <% person.obj.forEach(function (data, index) { %>
                <option value="<%=data.rowId%>" <%if(mConference&&mConference.createUserId?mConference.createUserId.rowId==data.rowId:data.rowId==userinfo.rowId){%>selected<%}%>><%=data.name%></option>
                <% })%>
            </select>
        </div>
        <div class="am-form-group">
            <label for="parentPoolId">所属股票池:</label>
            <select style="width: 100%" id="parentPoolId" name="parentPoolId" required>
                <%if(mConference && mConference.parentPoolId){
                  var parentPool = mConference.parentPoolId;%>
                  <option value="<%=parentPool.rowId%>" selected><%=parentPool.poolName%></option>
                <%}else{%>
                   <option></option>
                <%}%>
            </select>
        </div>
        <div class="am-form-group" style="display: none;">
            <select style="width: 100%;" id="childPoolId" name="childPoolId">
                <%if(!mConference || !mConference.childPoolId){%>
                <option></option>
                <%}%>
            </select>
        </div>
        <div class="am-form-group">
            <label for="doc-vld-name">调入价：</label>
            <input type="number" <% if(mConference && mConference.importPrice){ %>value="<%=mConference.importPrice%>"<% } %> id="importPrice" name="importPrice" placeholder="调入价" required>
        </div>

        <div class="am-form-group">
            <label for="doc-vld-name">目标价：</label>
            <input type="number" <% if(mConference && mConference.expectPrice){ %>value="<%=mConference.expectPrice%>"<% } %> id="expectPrice" name="expectPrice" placeholder="目标价" required>
        </div>


        <div class="am-form-group">
            <label for="doc-vld-name">入池理由：</label>
            <textarea class="" rows="5" id="reason" name="reason" placeholder="入池理由" ><%= (mConference && mConference.reason)||'' %></textarea>
        </div>

        <div class="am-form-group">
            <label for="attachmentName">附件：</label>
            <div class="am-g am-g-collapse">
                <div class="am-u-sm-9">
                    <input type="text" name="attachmentName" class="am-form-field" style="border-right:none;" <%if(mConference&&mConference.attachmentName){%>value="<%=mConference.attachmentName%>"<%}%>placeholder="附件" readonly>
                </div>
                <div class="am-u-sm-3 am-form-file">
                    <button type="button" class="am-form-field" style="color: #fff;background-color: #0e90d2;border-color: #0e90d2;"><i class="am-icon-cloud-upload"></i> 上传</button>
                    <input id="doc-form-file" name="file" type="file" multiple>
                </div>
            </div>
        </div>

        <button class="am-btn am-btn-secondary" type="submit" id="save" style="visibility:hidden">提交</button>

        <input id="expectRate" name="expectRate" placeholder="目标涨幅" type="hidden">

        <%if(mConference && mConference.rowId){%>
            <input name="rowId" value="<%=mConference.rowId%>" type="hidden">
        <%}%>
    </fieldset>
</form>

<script src="/javascripts/app/stockpool/stockpooladd.js"></script>

<% include ../footer.ejs %>